package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.dict.entity.DictItem;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ZhuChunXiao on 2017/5/19.
 * 个人信息
 */
@Entity
@Table(name="ec_personnelself")
public class PersonnelSelf extends BaseFlowEntity {
    private static final long serialVersionUID = 1705636353058303062L;
    /**
     * 人事信息表
     */
    private PersonnelInfo personnelInfo;
    /**
     * 出生日期
     */
    private Date birthday;
    /**
     * 籍贯
     */
    private String placeOrigin;
    /**
     * 民族
     */
    private String nation;
    /**
     * 居住地址
     */
    private String address;
    /**
     * 紧急联络人
     */
    private String urgentPerson;
    /**
     * 紧急联系电话
     */
    private String urgentPhone;
    /**
     * 户口所在地 1上海 2非上海
     */
    private int registeredResidence;
    /**
     * 居住证 1有 2没有
     */
    private int residencePermit;
    /**
     * 居住证开始日期
     */
    private Date reDateStart;
    /**
     * 居住证结束日期
     */
    private Date reDateEnd;
    /**
     * 婚姻状况 1已婚 2未婚
     */
    private int marry;
    /**
     * 最高学历
     */
    private DictItem education;
    /**
     * 毕业院校
     */
    private String school;
    /**
     * 家庭情况（保存的是json字符串）
     */
    private String family;
    /**
     * 关联用户的ID（quartz中用到的）
     */
    private String userId;
    /**
     * 此用户关联的人事专员ID（quartz中用到的）
     */
    private String personnelUserString;

    @OneToOne(fetch = FetchType.LAZY)
    public PersonnelInfo getPersonnelInfo() {
        return personnelInfo;
    }

    public void setPersonnelInfo(PersonnelInfo personnelInfo) {
        this.personnelInfo = personnelInfo;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPlaceOrigin() {
        return placeOrigin;
    }

    public void setPlaceOrigin(String placeOrigin) {
        this.placeOrigin = placeOrigin;
    }

    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUrgentPerson() {
        return urgentPerson;
    }

    public void setUrgentPerson(String urgentPerson) {
        this.urgentPerson = urgentPerson;
    }

    public String getUrgentPhone() {
        return urgentPhone;
    }

    public void setUrgentPhone(String urgentPhone) {
        this.urgentPhone = urgentPhone;
    }

    public int getRegisteredResidence() {
        return registeredResidence;
    }

    public void setRegisteredResidence(int registeredResidence) {
        this.registeredResidence = registeredResidence;
    }

    public int getResidencePermit() {
        return residencePermit;
    }

    public void setResidencePermit(int residencePermit) {
        this.residencePermit = residencePermit;
    }

    public Date getReDateStart() {
        return reDateStart;
    }

    public void setReDateStart(Date reDateStart) {
        this.reDateStart = reDateStart;
    }

    public Date getReDateEnd() {
        return reDateEnd;
    }

    public void setReDateEnd(Date reDateEnd) {
        this.reDateEnd = reDateEnd;
    }

    public int getMarry() {
        return marry;
    }

    public void setMarry(int marry) {
        this.marry = marry;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public DictItem getEducation() {
        return education;
    }

    public void setEducation(DictItem education) {
        this.education = education;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    @Type(type="text")
    public String getFamily() {
        return family;
    }

    public void setFamily(String family) {
        this.family = family;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Column(length = 500)
    public String getPersonnelUserString() {
        return personnelUserString;
    }

    public void setPersonnelUserString(String personnelUserString) {
        this.personnelUserString = personnelUserString;
    }

}
